package com.example.inami.basic.service;

import com.baomidou.mybatisplus.core.enums.SqlMethod;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.example.inami.basic.dao.Cfs119CompDao;
import com.example.inami.basic.entity.Cfs119Comp;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.binding.MapperMethod;
import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Service;

import java.util.Collection;
import java.util.List;
import java.util.function.BiConsumer;

/**
 * (Cfs119Comp)表服务实现类
 *
 * @author inami
 * @since 2025-04-09 10:58:50
 */
@Slf4j
@Service("cfs119CompService")
public class Cfs119CompService extends ServiceImpl<Cfs119CompDao, Cfs119Comp> implements IService<Cfs119Comp> {
    public void b1(List<Cfs119Comp> list) {
        //开始计时
        long startTime = System.currentTimeMillis();
        //String sqlStatement = this.sqlStatement(SqlMethod.UPDATE_BY_ID);
        baseMapper.updateInfoById(list.get(0));
        //String sqlStatement = SqlHelper.table(entityClass).getSqlStatement("updateInfoById");
        /*this.executeBatch(list, 300, (sqlSession, entity) -> {
            MapperMethod.ParamMap<Cfs119Comp> param = new MapperMethod.ParamMap<>();
            param.put("et", entity);
            sqlSession.update(sqlStatement, param);
            //sqlSession.update("updateInfoById",param);
        });*/
        //结束计时
        long endTime = System.currentTimeMillis();
        //计算耗时
        long duration = endTime - startTime;
        log.info("一体化平台--同步任务耗时:{}s", duration/1000);
    }
}

